﻿<%@ Page Title="Gestionar Beneficiarios" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="GestBeneficiarios.aspx.cs" Inherits="Triunfadores.Web.Clientes.GestBeneficiarios" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    
    <div class="box box-primary">
        <div class="box-header with-border">
            <h3 class="box-title">Buscar</h3>
             <div class="box-tools pull-right">
                <button title="Collapse" data-toggle="tooltip" data-widget="collapse" class="btn btn-box-tool"><i class="fa fa-minus"></i></button>
                <button title="Remove" data-toggle="tooltip" data-widget="remove" class="btn btn-box-tool"><i class="fa fa-times"></i></button>
            </div>
        </div>
        <div class="box-body">
            <div class="col-lg-6">
                <label>Ingrese el dni del socio</label>
                <div class="input-group">
                    <asp:TextBox ID="tbxDniBeneficiario" CssClass="form-control input-sm pull-right" Text="" runat="server" placeholder="Ingresa DNI del Cliente" MaxLength="8" />
                    <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender14"
                        TargetControlID="tbxDniBeneficiario"
                        FilterType="Numbers"
                        runat="server"></ajaxToolkit:FilteredTextBoxExtender>
                    <div class="input-group-btn">
                        <asp:Button CssClass="btn btn-sm btn-default" ID="btnBuscar" Text="Buscar" runat="server" />
                    </div>
                </div>
                <!-- /input-group -->
            </div>
        </div>
    </div>

    <div class="box box-primary">
        <div class="box-header with-border">
            <h3 class="box-title">Lista de Beneficiarios</h3>
        </div>
        <div class="box-body">
            <asp:UpdatePanel ID="upBeneficiarios" runat="server">
                <ContentTemplate>
                    <asp:ListView
                        ID="lvBeneficiarios"
                        ItemType="Triunfadores.BusinessEntities.Beneficiario"
                        runat="server"
                        SelectMethod="GetBeneficiarios" >
                        <EmptyDataTemplate>
                            <h4 class="message-error" align="center" style="color: Red"><strong>No hay beneficiarios que mostrar</strong></h4>
                        </EmptyDataTemplate>
                        <LayoutTemplate>
                            <table class="table table-hover table-condensed">
                                <thead>
                                    <tr>
                                        <th>Nombre</th>
                                        <th>DNI</th>
                                        <th>Dirección</th>
                                        <th>Teléfono</th>
                                        <th>Acciones</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr id="itemPlaceholder" runat="server"></tr>
                                </tbody>
                            </table>
                            <asp:DataPager ID="dpBeneficiarios" PagedControlID="lvBeneficiarios" runat="server" PageSize="15">
                                <Fields>
                                    <asp:NextPreviousPagerField
                                        ButtonType="Link"
                                        ShowFirstPageButton="true"
                                        ShowLastPageButton="true"
                                        ShowNextPageButton="true"
                                        ShowPreviousPageButton="true" />
                                </Fields>
                            </asp:DataPager>
                        </LayoutTemplate>
                        <ItemTemplate>
                            <tr>
                                <td><%#Item.Nombres %>&nbsp;<%#Item.Apellidos %></td>
                                <td><%#Item.Dni %></td>
                                <td><%#Item.Direccion %></td>
                                <td><%#Item.Telefono %></td>
                                <td>
                                    <a class="btn btn-warning btn-xs" href="../Clientes/Registrar?idBeneficiario=<%#Item.Id %>&opc=editar">
                                        <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
                                    </a>
                                    <a class="btn btn-danger btn-xs" href='~/Registrar?idBeneficiario=<%#Item.Id %>&opc=eliminar'
                                        onclick='return confirm("Desea Eliminar este elemento");'>
                                        <span class="glyphicon glyphicon-trash"></span>
                                    </a>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:ListView>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnBuscar" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
    </div>
</asp:Content>
